UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Am6zrcnHbr75EdvNTwhySjNGV/PezAxt3zdY0txoVo4='
WHERE
key_id = 'b5a556bb36181cb0771c924dc95a182e1dc3a043792a9c7aa44dbc829dfbab46'
AND (
token = 'Am6zrcnHbr75EdvNTwhySjNGV/PezAxt3zdY0txoVo4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)