UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dpdFrbqBsFclTLVemhPD94kQ3Quz7LLnRTN+sZBJBUw='
WHERE
key_id = 'ce8dc7e0991c9303afa5cd15ef3592519c0d319a6af54cfdeb80da40393cca80'
AND (
token = 'dpdFrbqBsFclTLVemhPD94kQ3Quz7LLnRTN+sZBJBUw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)