UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eT3Ko6BzmhvJ4G7H5ws8Z90Ra1aQlrn4xMswdynvUi0='
WHERE
key_id = '91fc12d3511f28383016b7ba326ae962d68fadfa7033a55b9a69fb5760868fc5'
AND (
token = 'eT3Ko6BzmhvJ4G7H5ws8Z90Ra1aQlrn4xMswdynvUi0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)