UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qozSlCTrnjIVim/gfJggrluXGh18it6hYS3ay2P6b44='
WHERE
key_id = '2510bd062c3c6b9b214007589a34a0d1687d5ca1c8c6713c3643ba198573a515'
AND (
token = 'qozSlCTrnjIVim/gfJggrluXGh18it6hYS3ay2P6b44='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)