UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DfgvWzsZqhILa83uroLzfchUAxd4/WU28UPnAtpaf1g=' 
WHERE 
  key_id = '63ff76189bc274af276d028c13b79c92a14808888f3c512a0e7d86174ca90c7d' 
  AND (
    token = 'DfgvWzsZqhILa83uroLzfchUAxd4/WU28UPnAtpaf1g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020