UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HCzV5iFwqZTc70GP1lJeaVRkZAyffUqfqqHl/updmXw='
WHERE
key_id = 'a8d303ec60288a717f2eafd838193c6fae161c228088dd23728496e390118aa4'
AND (
token = 'HCzV5iFwqZTc70GP1lJeaVRkZAyffUqfqqHl/updmXw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)