UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ga9I5RamVTbfNBmFw+U5WIBi9uMYTSHd1p+Zj75htdI='
WHERE
key_id = 'e1a7128cf3efbfc1fc6c67b1b0178e6f67b8b470d1c67b78aa168263d6c6d4ab'
AND (
token = 'Ga9I5RamVTbfNBmFw+U5WIBi9uMYTSHd1p+Zj75htdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)