UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MbcXeQLZlCqoF86HeNqVboCshZP2zrjO2nIQdcxR+00=' 
WHERE 
  key_id = '52ce80d0bb1ecb243d907d4a934eef00251ab2cc61e1746046cfe1bc1eac4d96' 
  AND (
    token = 'MbcXeQLZlCqoF86HeNqVboCshZP2zrjO2nIQdcxR+00=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027