UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'borj5DiZNufI2neKzxglUJrIxLDij+8Zr1GTclf04+0='
WHERE
key_id = '92c8c324b8ab850f46da1d678b7ba491629173391a3e61bd85efb973810dabbd'
AND (
token = 'borj5DiZNufI2neKzxglUJrIxLDij+8Zr1GTclf04+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)