UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pjzzBx9eFeRGz2e8m2XYbF8uEUmOTPIcqN8lnl649J8='
WHERE
key_id = '4a5c4e28ba1b2f543b5c90aef59fd1585e5761babc8771aa13075b655cd746d3'
AND (
token = 'pjzzBx9eFeRGz2e8m2XYbF8uEUmOTPIcqN8lnl649J8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)