UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PSFbfyqIgOcJvbqb2WiCjzcybNaaRMA/wTNb5D1Ij78='
WHERE
key_id = '53c2bd86215b01e81e9a0c707f62fb4d3fbcfcf8d49f8d6963146ecf03b42f23'
AND (
token = 'PSFbfyqIgOcJvbqb2WiCjzcybNaaRMA/wTNb5D1Ij78='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)