UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oEX5Xlm3ZYchkv1Eq05WpcSu4cHOXASfpEpunoqhmAk=' 
WHERE 
  key_id = '8619a56a93b653dd213cdab96609ff000836c2ab41fcef470fbd87f0b28318d5' 
  AND (
    token = 'oEX5Xlm3ZYchkv1Eq05WpcSu4cHOXASfpEpunoqhmAk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040