UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0AGqDYwJ6eRxBNVFCdrRWWlp/K8vvxIFEL0G7S4AgDg=' 
WHERE 
  key_id = 'ad49c099d2700b836a43bfc1c4acd6dfebbd7be7eb5d9d8f29e81b71138b336e' 
  AND (
    token = '0AGqDYwJ6eRxBNVFCdrRWWlp/K8vvxIFEL0G7S4AgDg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031