UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wp1xakmwNcDfZkh1CyE9ly6vikX9ct2ekVDp2fyeGHw='
WHERE
key_id = 'bb54e6df3f3009447a06312c4f02e2ee5bf5f4028549e0737bc8dc6f1567f7ff'
AND (
token = 'Wp1xakmwNcDfZkh1CyE9ly6vikX9ct2ekVDp2fyeGHw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)