UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rrWVJe94zM5W6quydyn42SIk6rQAFnQCpkeGCSpxUW8='
WHERE
key_id = '25cee56c4b2e4da1a115e16b6675d2208c159b1383443987ca6544fe59fd469e'
AND (
token = 'rrWVJe94zM5W6quydyn42SIk6rQAFnQCpkeGCSpxUW8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)