UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PA3Y9N+vKaObvABCejPAPypr7VgjUp2SiYCULnyauKs='
WHERE
key_id = 'e0199826ebdb5679545936c6a6b593d6122d87657fb3d405de63db4f8b59d47a'
AND (
token = 'PA3Y9N+vKaObvABCejPAPypr7VgjUp2SiYCULnyauKs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)