UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6X2ekk+0sjx90AeWePGYuSRAioNftDulTUFBFsypeZo='
WHERE
key_id = '33ba0e6ce98b51f4ea6defc44c234d7fb123f7218f17563a99e0600306ff54d6'
AND (
token = '6X2ekk+0sjx90AeWePGYuSRAioNftDulTUFBFsypeZo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)