UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C6eQm5EM00GB968g0lpd75VIeOtaHjQxeKbVcicPKho='
WHERE
key_id = '66dc4f5a7e25afe53bd09ee0a716e63eab93f9d3140f8b397de60ad794ee3559'
AND (
token = 'C6eQm5EM00GB968g0lpd75VIeOtaHjQxeKbVcicPKho='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)