UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4mZRKx6QLY6/Myb5FXDWUWa+ATNkeirC2B8aLXKwpI4='
WHERE
key_id = '426120f5cee32ca8269fb072815c8d8ef87ab2a94ad10368600f68b1bb211aeb'
AND (
token = '4mZRKx6QLY6/Myb5FXDWUWa+ATNkeirC2B8aLXKwpI4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)