UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZSzeaqYtqpft1ooX0PvDmbdrS7SqZME+1a6uaJ28wGg=' 
WHERE 
  key_id = '2fcc923c22328669baeb01d57e126718bb48c18faf4119e14cdd2dc7db5e7675' 
  AND (
    token = 'ZSzeaqYtqpft1ooX0PvDmbdrS7SqZME+1a6uaJ28wGg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025