UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GjzRMmcRLSEiZkCDGOkRcLsVnTfcapnq9waDcWDJT3U='
WHERE
key_id = '51d3e0dc9e12eb0c70852b735f66d94d2b2f8d1cd43c53f26c159f4286de3ae1'
AND (
token = 'GjzRMmcRLSEiZkCDGOkRcLsVnTfcapnq9waDcWDJT3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)