UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/wEnyq08VYzB+Tpr13QiY6NI250ddFDRFsM0OxRDuh8='
WHERE
key_id = '2d02079c6eeff160a69d1155ca3917176e6060f665921b530761e952e1261f69'
AND (
token = '/wEnyq08VYzB+Tpr13QiY6NI250ddFDRFsM0OxRDuh8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)