UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CYBdh/ZcxNdVSE1WTzKrAmltg4p4JhTAxvPf7cei/Ak='
WHERE
key_id = '19a2daba020efa335ef70305821a03e37d2be0b314839f3f4a4214b5ed9af55d'
AND (
token = 'CYBdh/ZcxNdVSE1WTzKrAmltg4p4JhTAxvPf7cei/Ak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)