UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4gLTJEdXxtFl/tGcCtaXrlLQJ2QFjR6Y3n8hJ690Y6A=' 
WHERE 
  key_id = '3377a742564b23fac44be75c3b8de2b2d46b83ff930adbce11ab24cd40915c82' 
  AND (
    token = '4gLTJEdXxtFl/tGcCtaXrlLQJ2QFjR6Y3n8hJ690Y6A=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050