UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P706qkA1agBvcHW1f939G6owb1SQs1vPHGDenZqXuZc='
WHERE
key_id = '775253a8d5f9603621fb674fd7d383fcd78331a2d5cd2a295d9bb68a66f2f628'
AND (
token = 'P706qkA1agBvcHW1f939G6owb1SQs1vPHGDenZqXuZc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)