UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ThQ43vLznujlDBQjdtTiw2DRsNNVGqBWrtEqPB2uiXg='
WHERE
key_id = 'c1735efcaa191b290ba00f10b99448487625cf4b46644152d11af585238666ad'
AND (
token = 'ThQ43vLznujlDBQjdtTiw2DRsNNVGqBWrtEqPB2uiXg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)