UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pjQtXlxZKeQ08/UhWi36dz60KBTFGWyowbaSuvORsw8='
WHERE
key_id = '9a2ad9b267af1be874affe2ab6d4d55e4178623b2ab8cd9cca7ebfb2fda5d2d9'
AND (
token = 'pjQtXlxZKeQ08/UhWi36dz60KBTFGWyowbaSuvORsw8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)